Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree pruning #67

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Tree pruning #67

wants to merge 2 commits into from

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jan 5, 2021

This produces a ResolutionImpossible against pip install prefect[all_extras] --only-binary :all: in ~30s.

Still much to work on, mainly error reporting seems wrong. I can’t make sense of the report from the perfect example. It contains many prefect[all-extras] entries (different versions), but does not actually show where the conflict is. But the approach itself seems to work.

@uranusjr
Copy link
Member Author

uranusjr commented Jan 5, 2021

Also need to write comments to describe how things work.

@uranusjr uranusjr force-pushed the pruning branch 3 times, most recently from 353f6db to 133db3c Compare January 5, 2021 13:50
Copy link
Contributor

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks great to me.

I'm a little concerned about the flexibility we're giving the provider here, but, I guess that's a ship that sailed a while back. 🙃

@uranusjr
Copy link
Member Author

uranusjr commented Jan 5, 2021

Forgot to mention: Please feel free to suggest alternative method names. I’m terrible at this.


Both arguments are iterators yielding requirement objects. A boolean
should be returned to indicate whether the two sets should be treated
as matching.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also mention requirements_a is the new state, and requirements_b is from a known-to-fail state. This is important since the provider can implement range merging to return True when requirements_a is a subset of requirements_b to prune additional subtrees.

(The method name should probably change.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTOH if requirements_a is a superset of requirements_b, this should be used to exclude requirements_b from requirements_a so the resolver can avoid visiting some subtrees. Maybe the interface should be defined to perform specifier merging instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants